package seabattle.ship;

public class Coordinates {
    private final int x;
    private final int y;

    public Coordinates(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public boolean equals(Coordinates other) {
        if (other == null) {
            return false;
        } else if (this == other) {
            return true;
        }
        return x == other.getX() && y == other.getY();
    }

    public String toString() {
        return String.format("[%s,%s]", x, y);
    }
}
